#ifndef BOARDITEM_H
#define BOARDITEM_H

#include <QGraphicsItem>
#include <QPainter>
#include <QBrush>
#include <QColor>
#include <QRadialGradient>
#include "dataqueenfile.h"

class BoardItem : public QGraphicsItem
{
public:
	BoardItem(QRect rect = QRect(0,0,50,50),ColorBoardItem color = White):rectBoard(rect),colorItem(color)
	{}
	void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
	{
		painter->setPen(QColor(Qt::black));
		painter->setBackground(QBrush(QColor(Qt::black)));
		if(colorItem == White)
			painter->setBrush(QBrush(QColor(Qt::white)));
		else
			painter->setBrush(QBrush(QColor(Qt::black)));
		painter->drawRect(rectBoard);
	}
	QRectF boundingRect()const
	{
		qreal a = 2;
		return QRectF(-50-a,-50-a,50+a,50+2);
	}
	QRect rectBoard;
	ColorBoardItem colorItem;
};

#endif // BOARDITEM_H
